import request from "@/utils/request";

// 新增商机
export function addBusiness(data) {
  return request({
    url: "/system/opportunity",
    method: "post",
    data: data,
  });
}

// 修改商机
export function editBusiness(data) {
  return request({
    url: "/system/opportunity",
    method: "put",
    data: data,
  });
}

// 商机详情
export function businessDetail(id) {
  return request({
    url: `/system/opportunity/${id}`,
    method: "get",
  });
}

// 商机列表
export function getBusinessList(params) {
  return request({
    url: "/system/opportunity/list",
    method: "get",
    params,
  });
}

// 审核商机
export function approveBusiness(params, data) {
  return request({
    url: "/system/opportunity/approve",
    method: "post",
    data: data,
    params,
  });
}


// 删除商机
export function deleteBusiness(ids) {
  return request({
    url: `/system/opportunity/${ids}`,
    method: "delete",
  });
}


// 分配商机
export function assignBusiness(params, data) {
  return request({
    url: "/system/project/setSolationManager",
    method: "post",
    data: data,
    params,
  });
}


// 分配商机 营服主任 行业bu
export function assignBusinessBu(params, data) {
  return request({
    url: "/system/project/setBUAndAreaDirector",
    method: "post",
    data: data,
    params,
  });
}
